package com.pstreets.lwuit.demo;


import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import javax.microedition.midlet.MIDlet;

/**
 * @author james
 */
public class HelloMIDlet extends MIDlet {

    public void startApp() {
        
        //init the LWUIT display
        Display.init(this);
        
        //setting the application theme
        try{
            Resources r=Resources.open("/LWUITtheme.res");
            UIManager.getInstance()
                    .setThemeProps(r.getTheme
                    (r.getThemeResourceNames()[0]));
        }catch (Exception e){}
        
        
        Form f=new Form();
        f.setTitle("Hello World");
        f.setLayout(new BorderLayout());
        f.addComponent("Center", 
                new Label("My first LWUIT app"));
        f.show();
    
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}
